package com.win.Interceptor;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.stereotype.Component;

import java.util.UUID;
@Component
public class XTokenRequestInterceptor implements RequestInterceptor {
    @Override
    public void apply(RequestTemplate template) {
        // 添加自定义请求头 X-Token
        template.header("X-Token", UUID.randomUUID().toString());
        System.out.println("XTokenRequestInterceptor 执行拦截处理......");
    }
}